home *** CD-ROM | disk | FTP | other *** search
Wrap
property spriteNum, pBricksLeft, pKount, pTemper, pTempDirection global gSlowDown, gBallDirection, gLevel, gScore, gLocH, gLocV, gBallSpeed, gPaddleHits, gPause, gFallingBricks, gFallSprite, gDescend, h, v, pMyAngle, gGoBall on beginSprite repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat pSlowDown = 0 pKount = 0 gFallingBricks = [0, 0, 0, 0] gDescend = [0, 0, 0, 0] gFallSprite = [0, 0, 0, 0] end on exitFrame me donutAttack(me) if gPause = 0 then if (sprite(4).locH > (sprite(spriteNum).locH - 50)) and (sprite(4).locH < (sprite(spriteNum).locH + 50)) and (sprite(4).locV < (sprite(spriteNum).locV + 25)) and (sprite(4).locV > (sprite(spriteNum).locV - 25)) then if sprite(4).intersects(spriteNum) then if (sprite(spriteNum).member.name = "Brick_crome") or (sprite(spriteNum).member.name = "Brick02_animated") or (sprite(spriteNum).member.name = "GooBrickShort") or (sprite(spriteNum).member.name = "Brick_Metal02") or (sprite(spriteNum).member.name = "Brick01_animated") then puppetSound(1, "brick") gLocH = gLocH - h gLocV = gLocV - v updateStage() repeat with pTemper = 1 to 17 pTempDirection = getAngle(sprite(4).locH, sprite(4).locV, sprite(5).locH, sprite(5).locV) pMyAngle = pTempDirection * PI / 180.0 h = sin(pMyAngle) * 1 v = -cos(pMyAngle) * 1 gLocH = gLocH + h gLocV = gLocV + v sprite(5).loc = point(gLocH, gLocV) if sprite(5).intersects(spriteNum) then pBottomDist = abs(sprite(5).rect.top - sprite(spriteNum).rect.bottom) pTopDist = abs(sprite(spriteNum).rect.top - sprite(5).rect.bottom) pRightDist = abs(sprite(5).rect.left - sprite(spriteNum).rect.right) pLeftDist = abs(sprite(spriteNum).rect.left - sprite(5).rect.right) if (pBottomDist < pTopDist) and (pBottomDist < pLeftDist) and (pBottomDist < pRightDist) then BottomCollision() else if (pTopDist < pBottomDist) and (pTopDist < pLeftDist) and (pTopDist < pRightDist) then TopCollision() else if (pRightDist < pBottomDist) and (pRightDist < pLeftDist) and (pRightDist < pTopDist) then gBallDirection = 270 - gBallDirection + 90 + (random(4) - 2) LeftAndRightCollision() else if (pLeftDist < pBottomDist) and (pLeftDist < pRightDist) and (pLeftDist < pTopDist) then gBallDirection = 90 - gBallDirection + 270 + (random(4) - 2) LeftAndRightCollision() end if end if end if end if sprite(4).loc = sprite(5).loc exit repeat end if end repeat if gLevel = 1 then pKount = 0 repeat with pBricksLeft = 20 to 79 if sprite(pBricksLeft).visible = 0 then pKount = pKount + 1 end if if pKount >= 32 then repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat sprite(80).visible = 0 sprite(12).visible = 1 sprite(12).locV = 220 gPause = 1 gBallSpeed = 4 gPaddleHits = 0 gBallDirection = 180.0 gLocH = 290 gLocV = 270 member("Level1Score").text = "Level 1 Score:" && string(gScore) member("Level1Score_b").text = "Level 1 Score:" && string(gScore) go(16) end if end repeat pKount = 0 else if gLevel = 2 then pKount = 0 repeat with pBricksLeft = 20 to 79 if sprite(pBricksLeft).visible = 0 then pKount = pKount + 1 end if if pKount >= 50 then repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat sprite(80).visible = 0 sprite(12).visible = 1 sprite(12).locV = 220 gPause = 1 gBallSpeed = 4 gPaddleHits = 0 gBallDirection = 180.0 gLocH = 290 gLocV = 270 member("Level2_score").text = "Level 2 Score:" && string(gScore) member("Level2_score_b").text = "Level 2 Score:" && string(gScore) go(29) end if end repeat pKount = 0 else if gLevel = 3 then pKount = 0 repeat with pBricksLeft = 20 to 79 if sprite(pBricksLeft).visible = 0 then pKount = pKount + 1 end if if pKount >= 50 then repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat sprite(80).visible = 0 sprite(12).visible = 1 sprite(12).locV = 220 gPause = 1 gBallSpeed = 4 gPaddleHits = 0 gBallDirection = 180.0 gLocH = 290 gLocV = 270 member("Level3Score").text = "Level 3 Score:" && string(gScore) member("Level3Score_b").text = "Level 3 Score:" && string(gScore) go(41) end if end repeat pKount = 0 else if gLevel = 4 then pKount = 0 repeat with pBricksLeft = 20 to 79 if sprite(pBricksLeft).visible = 0 then pKount = pKount + 1 end if if pKount >= 26 then repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat sprite(80).visible = 0 sprite(12).visible = 1 sprite(12).locV = 220 gPause = 1 gBallSpeed = 4 gPaddleHits = 0 gBallDirection = 180.0 gLocH = 290 gLocV = 270 member("Leve4Score").text = "Level 4 Score:" && string(gScore) member("Leve4Score_b").text = "Level 4 Score:" && string(gScore) go(54) end if end repeat pKount = 0 else if gLevel = 5 then pKount = 0 repeat with pBricksLeft = 20 to 79 if sprite(pBricksLeft).visible = 0 then pKount = pKount + 1 end if if pKount >= 22 then repeat with pBricksLeft = 20 to 79 sprite(pBricksLeft).visible = 1 end repeat sprite(80).visible = 0 sprite(12).visible = 1 sprite(12).locV = 220 gPause = 1 gBallSpeed = 4 gPaddleHits = 0 gBallDirection = 180.0 gLocH = 290 gLocV = 270 member("FinalScore").text = "Final Score:" && string(gScore) member("FinalScore_b").text = "Final Score:" && string(gScore) go(69) end if end repeat pKount = 0 end if end if end if end if end if end if if gBallDirection > 360 then gBallDirection = gBallDirection - 360 else if gBallDirection < 0 then gBallDirection = gBallDirection + 360 end if end if end if end if end if end on TopCollision if sprite(spriteNum).member.name = "Brick_crome" then gBallDirection = 0 - gBallDirection + 180 + (random(4) - 2) sprite(spriteNum).visible = 0 sprite(spriteNum).member = 0 gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick01_animated" then gBallDirection = 0 - gBallDirection + 180 + (random(4) - 2) sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick02_animated" then gBallDirection = 290 + random(140) sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "GooBrickShort" then sprite(spriteNum).member = "GooDrop_Ani_12f" gBallDirection = 0 - gBallDirection + 180 + (random(4) - 2) if gFallingBricks[1] = 0 then puppetSound(3, "blue circle drop") gFallSprite[1] = spriteNum gFallingBricks[1] = 1 else if gFallingBricks[2] = 0 then puppetSound(3, "blue circle drop") gFallSprite[2] = spriteNum gFallingBricks[2] = 1 else if gFallingBricks[3] = 0 then puppetSound(3, "blue circle drop") gFallSprite[3] = spriteNum gFallingBricks[3] = 1 else if gFallingBricks[4] = 0 then puppetSound(3, "blue circle drop") gFallSprite[4] = spriteNum gFallingBricks[4] = 1 end if end if end if end if gScore = gScore + 300 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick_Metal02" then gBallDirection = 180 - gBallDirection + 360 + (random(4) - 2) end if end if end if end if end if end on BottomCollision if sprite(spriteNum).member.name = "Brick_crome" then gBallDirection = 180 - gBallDirection + 360 + (random(4) - 2) sprite(spriteNum).visible = 0 sprite(spriteNum).member = 0 gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick01_animated" then gBallDirection = 180 + (random(8) - 4) sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick02_animated" then gBallDirection = 110 + random(140) sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "GooBrickShort" then sprite(spriteNum).member = "GooDrop_Ani_12f" gBallDirection = 180 - gBallDirection + 360 + (random(4) - 2) if gFallingBricks[1] = 0 then puppetSound(3, "blue circle drop") gFallSprite[1] = spriteNum gFallingBricks[1] = 1 else if gFallingBricks[2] = 0 then puppetSound(3, "blue circle drop") gFallSprite[2] = spriteNum gFallingBricks[2] = 1 else if gFallingBricks[3] = 0 then puppetSound(3, "blue circle drop") gFallSprite[3] = spriteNum gFallingBricks[3] = 1 else if gFallingBricks[4] = 0 then puppetSound(3, "blue circle drop") gFallSprite[4] = spriteNum gFallingBricks[4] = 1 end if end if end if end if gScore = gScore + 300 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick_Metal02" then gBallDirection = 180 - gBallDirection + 360 + (random(4) - 2) end if end if end if end if end if end on LeftAndRightCollision if sprite(spriteNum).member.name = "Brick_crome" then sprite(spriteNum).visible = 0 sprite(spriteNum).member = 0 gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick01_animated" then sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "Brick02_animated" then sprite(spriteNum).member = "Brick_crome" gScore = gScore + 100 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) else if sprite(spriteNum).member.name = "GooBrickShort" then sprite(spriteNum).member = "GooDrop_Ani_12f" if gFallingBricks[1] = 0 then puppetSound(3, "blue circle drop") gFallSprite[1] = spriteNum gFallingBricks[1] = 1 else if gFallingBricks[2] = 0 then puppetSound(3, "blue circle drop") gFallSprite[2] = spriteNum gFallingBricks[2] = 1 else if gFallingBricks[3] = 0 then puppetSound(3, "blue circle drop") gFallSprite[3] = spriteNum gFallingBricks[3] = 1 else if gFallingBricks[4] = 0 then puppetSound(3, "blue circle drop") gFallSprite[4] = spriteNum gFallingBricks[4] = 1 end if end if end if end if gScore = gScore + 300 member("Score01").text = "Score:" && string(gScore) member("Score02").text = "Score:" && string(gScore) end if end if end if end if end on donutAttack me if gFallingBricks[1] = 1 then if sprite(gFallSprite[1]).locV <= 450 then gSlowDown = gSlowDown + 1 if gSlowDown >= 7 then sprite(gFallSprite[1]).locV = sprite(gFallSprite[1]).locV + 1 gSlowDown = 0 end if if sprite(gFallSprite[1]).intersects(2) then sprite(2).member = "ship_frame 4" sprite(gFallSprite[1]).locV = 500 sprite(gFallSprite[1]).visible = 0 if sprite(15).visible = 1 then deathSequence() end if sprite(80).play() gGoBall = 0 loseALife() end if else sprite(gFallSprite[1]).visible = 0 end if end if if gFallingBricks[2] = 1 then if sprite(gFallSprite[2]).locV <= 450 then gSlowDown = gSlowDown + 1 if gSlowDown >= 7 then sprite(gFallSprite[2]).locV = sprite(gFallSprite[2]).locV + 1 gSlowDown = 0 end if if sprite(gFallSprite[2]).intersects(2) then sprite(2).member = "ship_frame 4" sprite(gFallSprite[2]).locV = 500 sprite(gFallSprite[2]).visible = 0 if sprite(15).visible = 1 then deathSequence() end if sprite(80).play() gGoBall = 0 loseALife() end if else sprite(gFallSprite[2]).visible = 0 end if end if if gFallingBricks[3] = 1 then if sprite(gFallSprite[3]).locV <= 450 then gSlowDown = gSlowDown + 1 if gSlowDown >= 7 then sprite(gFallSprite[3]).locV = sprite(gFallSprite[3]).locV + 1 gSlowDown = 0 end if if sprite(gFallSprite[3]).intersects(2) then sprite(2).member = "ship_frame 4" sprite(gFallSprite[3]).locV = 500 sprite(gFallSprite[3]).visible = 0 if sprite(15).visible = 1 then deathSequence() end if sprite(80).play() gGoBall = 0 loseALife() end if else sprite(gFallSprite[3]).visible = 0 end if end if if gFallingBricks[4] = 1 then if sprite(gFallSprite[4]).locV <= 450 then gSlowDown = gSlowDown + 1 if gSlowDown >= 7 then sprite(gFallSprite[4]).locV = sprite(gFallSprite[4]).locV + 1 gSlowDown = 0 end if if sprite(gFallSprite[4]).intersects(2) then sprite(2).member = "ship_frame 4" sprite(gFallSprite[4]).locV = 500 sprite(gFallSprite[4]).visible = 0 if sprite(15).visible = 1 then deathSequence() end if sprite(80).play() gGoBall = 0 loseALife() end if else sprite(gFallSprite[4]).visible = 0 end if end if end